X-Git-Url: https://permondes.de/gitweb/Analog_Engine.git/blobdiff_plain/b0b8ac6f98d48eb700cce1f18b401ccf1ea99d78..6d26a6bd8b30ad893da0315655d2f68aee787515:/scripts/TP1%2003.08%20Charge%20in%20em%20field.LACE diff --git a/scripts/TP1 03.08 Charge in em field.LACE b/scripts/TP1 03.08 Charge in em field.LACE new file mode 100644 index 0000000..955f475 --- /dev/null +++ b/scripts/TP1 03.08 Charge in em field.LACE @@ -0,0 +1,31 @@ +#PROGRAM-ID ChargeInEMfield +#VERSION 20240116 +# A mass m with charge q>0 is located in a static electro-magnetic field [0,0,E], [0,-B,0]. +# Find the trajetory +# Differential equation (Lorentz force): +# x'' = omega*z' +# z'' = a*omega^2 - omega*x' +# good start settings are omega=0,92, a*omega^2=0,05 + +# coefficient definition +alias coefficient.1 -> omega_x # -omega for x' +coefficient.2 (+1) -> a*omega^2 +alias coefficient(3) -> omega_z # omega for z' + +# solving the DE +iintegrate (x'') -> -x' +iintegrate (-x') -> x + +coefficient.omega_x (-x') -> -omega*x' +#cmultiply (-x', omega_x) -> omega*x' + +iintegrate (a*omega^2, -omega*x') -> -z' # input is z'' +iintegrate (-z') -> z +invert (-z') -> z' + +coefficient.omega_z (z') -> omega*z' +#cmultiply (z', omega_z) -> omega*z' +assign omega*z' -> x'' + +output(x) -> out.x +output(z) -> out.z